package cn.edu.zut.soft.student.controller.admin.student;

import cn.edu.zut.soft.student.bean.ResultBean;
import cn.edu.zut.soft.student.model.Course;
import cn.edu.zut.soft.student.model.StudentSelectCourses;
import cn.edu.zut.soft.student.service.student.StudentSelectCoursesBo;
import cn.edu.zut.soft.student.service.student.vo.StudnetQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author ChrisPhantom
 * @CreatDate 2021/02/22 19:44
 */

@RestController
@RequestMapping("/admin/api/selectstudent")
public class StudentSelectCoursesController {
    @Autowired
    private StudentSelectCoursesBo sscb;

    @GetMapping("")
    public ResultBean<List<StudentSelectCourses>> queryStudentsSelectCourses(StudnetQuery studnetQuery) {
        return new ResultBean<>(sscb.queryStudentSelectCourses(studnetQuery));
    }

    @GetMapping("/{studentid}")
    public ResultBean<List<Course>> querySelectCoursesById(@PathVariable("studentid") String studentid) {
        return new ResultBean<>(sscb.querySelectCourses(studentid));
    }

}
